/**
 * Created by s-wangh on 2017/11/10.
 */
import {Injectable} from "@angular/core";
import {HttpClient} from "../../../providers/httpClient";
@Injectable()
export class StockRecommendService {
  constructor(private httpClient: HttpClient) {

  }

  //获取orgid
  getOrgid(loginName: string) {
    let postBody = {
      "module": "KSB",
      "method": "IRM_A02_0010",
      "format":"json",
      "params": {
        logonname: loginName
      }
    };
    return this.httpClient.post(postBody,{
      isShowLoading: false
    });
    // console.log("~~~~~~~~~~~~~~~~~~");
    // console.log(this.httpClient.post(postBody));
    // console.log("#~~~~~~~~~~~~~~~~~~#");
    // console.log("!!!!!!!!");
    // console.log(orgId.toString());
    // this.getStockRecommend(999004444, '2001-11-11', '2017-11-16');
  }

  //获取最近金股推荐
  getStockRecommend(orgId: number, startDate: any, endDate: any, page?: number, pageSize?: number) {
    let postBody = {
      "module": "KSB",
      "method": "IRM_A02_0090",
      "format":"json",
      // "module": "OAServer",
      // "method": "getGoldenStockRecommend",
      "params": {
        orgid: orgId,
        startdate: startDate,
        enddate: endDate,
        // page: page,
        // pageSize: pageSize
      }
    };
    return this.httpClient.post(postBody, {
      isShowLoading: true
    });
  }

}
